home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cpptutor.arc
/
VEHICLE.CPP
< prev
next >
Wrap
Text File
|
1991-04-28
|
595b
|
33 lines
// Chapter 7 - Program 2
#include "vehicle.hpp"
// initialize to any data desired
void vehicle::initialize(int in_wheels, float in_weight)
{
wheels = in_wheels;
weight = in_weight;
}
// get the number of wheels of this vehicle
int vehicle::get_wheels()
{
return wheels;
}
// return the weight of this vehicle
float vehicle::get_weight()
{
return weight;
}
// return the weight on each wheel
float vehicle::wheel_loading()
{
return weight/wheels;
}